package com.ywk.springCore.lifeCycle.handRegistryBean;

import com.ywk.springCore.lifeCycle.core.Card;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.PostConstruct;

/**
 * @Author zbh
 * @Date 2023/5/7
 */
@Slf4j
@Data
public class HandBeanRegistry {

    Integer id;

    Card card;

    public HandBeanRegistry() {
        log.info("实例化：{}",this);
    }

    @PostConstruct
    public void initByPostConstruct(){
        this.id=2;
        log.info("执行初始化方式1（@PostConstruct）设置属性后：{}",this);
    }

    @Override
    public String toString() {
        return "HandBeanRegistry{" +
                "id='" + id + '\'' +
                ", card=" + card +
                '}';
    }
}
